﻿using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
using Volo.Abp.Account;
using Volo.Abp.Identity;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Modularity;
using Volo.Abp.TenantManagement;
using ERP.RBAC;
using ERP.ProductionManage;
using ERP.EquipmentManage;
using ERP.WorkforceManage;
using Microsoft.Extensions.DependencyInjection;
using ERP.HumanResources.Production.MasterData;
using ERP.MasterData;
using ERP.RepositoryManage;
using ERP.Application.RepositoryManage;
using ERP.QualityAssurance;
using ERP.HumanResources.HumanResourceManagement;
using ERP.WarehouseManagement;

namespace ERP;

[DependsOn(
    typeof(ERPDomainModule),
    typeof(ERPApplicationContractsModule),
    typeof(AbpPermissionManagementApplicationModule),
    typeof(AbpFeatureManagementApplicationModule),
    typeof(AbpIdentityApplicationModule),
    typeof(AbpAccountApplicationModule),
    typeof(AbpTenantManagementApplicationModule),
    typeof(AbpSettingManagementApplicationModule)
    )]
public class ERPApplicationModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<ERPApplicationModule>();
        });

        // 注册 RBAC 服务
        context.Services.AddTransient<IRoleServicers, RoleServices>();
        context.Services.AddTransient<IUserServices, UserServices>();
        context.Services.AddTransient<IUserRoleServices, UserRoleServices>();
        context.Services.AddTransient<IPermissionServices, PermissionServices>();
        
        // 注册生产管理服务
        context.Services.AddTransient<ICustomerOrderService, CustomerOrderService>();
        context.Services.AddTransient<IProductionReturnService, ProductionReturnService>();
        
        // 注册设备管理服务
        context.Services.AddTransient<IRpeairService, RpeairService>();
        context.Services.AddTransient<IEquipmentMaintenancePlanService, EquipmentMaintenancePlanService>();
        context.Services.AddTransient<IDvsubjectService, DvsubjectService>();
        
        // 注册班组管理服务
        context.Services.AddTransient<ITeamService, TeamService>();
        context.Services.AddTransient<ISchedulingPlanService, SchedulingPlanService>();
        context.Services.AddTransient<IClassesService, ClassesService>();

        // 注册工序配置服务
        context.Services.AddTransient<IProcessConfigurationService, ProcessConfigurationService>();

        // 注册物料分类服务
        context.Services.AddTransient<IMaterialClassService, MaterialClassService>();
        
        // 注册装箱管理服务
        context.Services.AddTransient<IPackingService, PackingService>();

        // 注册车间设置服务
        context.Services.AddTransient<IWorkshopService, WorkshopService>();

        // 注册检测项设置服务
        context.Services.AddTransient<ITestitemsettingService, TestitemsettingService>();
        
        // 注册仓库管理服务
        context.Services.AddTransient<IInventoryTransactionService, InventoryTransactionService>();

        // 注册人力资源相关服务
        context.Services.AddTransient<ILoginServices, LoginServices>();
        context.Services.AddTransient<IMenuServices, MenuServices>();
        context.Services.AddTransient<IMaterialService, MaterialService>();
        context.Services.AddTransient<ICustomerManagementService, CustomerManagementService>();
        context.Services.AddTransient<IJobApplicationService, JobApplicationService>();
        context.Services.AddTransient<IPositionLevelService, PositionLevelService>();
        context.Services.AddTransient<IProductionDispatchService, ProductionDispatchService>();
        context.Services.AddTransient<IProcurementService, ProcurementService>();
    }
}
